package com.hyb.hybmodulesblog.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hyb.hybmodulesblog.mapper.TribeMapper;
import com.hyb.hybmodulesblog.domain.Tribe;
import com.hyb.hybmodulesblog.service.ITribeService;

/**
 * 部落表增删改查Service业务层处理
 * 
 * @author hyb
 * @date 2023-03-11
 */
@Service
public class TribeServiceImpl implements ITribeService 
{
    @Autowired
    private TribeMapper tribeMapper;

    /**
     * 查询部落表增删改查
     * 
     * @param id 部落表增删改查主键
     * @return 部落表增删改查
     */
    @Override
    public Tribe selectTribeById(Long id)
    {
        return tribeMapper.selectTribeById(id);
    }

    /**
     * 查询部落表增删改查列表
     * 
     * @param tribe 部落表增删改查
     * @return 部落表增删改查
     */
    @Override
    public List<Tribe> selectTribeList(Tribe tribe)
    {
        return tribeMapper.selectTribeList(tribe);
    }

    /**
     * 新增部落表增删改查
     * 
     * @param tribe 部落表增删改查
     * @return 结果
     */
    @Override
    public int insertTribe(Tribe tribe)
    {
        tribe.setCreateTime(DateUtils.getNowDate());
        return tribeMapper.insertTribe(tribe);
    }

    /**
     * 修改部落表增删改查
     * 
     * @param tribe 部落表增删改查
     * @return 结果
     */
    @Override
    public int updateTribe(Tribe tribe)
    {
        tribe.setUpdateTime(DateUtils.getNowDate());
        return tribeMapper.updateTribe(tribe);
    }

    /**
     * 批量删除部落表增删改查
     * 
     * @param ids 需要删除的部落表增删改查主键
     * @return 结果
     */
    @Override
    public int deleteTribeByIds(Long[] ids)
    {
        return tribeMapper.deleteTribeByIds(ids);
    }

    /**
     * 删除部落表增删改查信息
     * 
     * @param id 部落表增删改查主键
     * @return 结果
     */
    @Override
    public int deleteTribeById(Long id)
    {
        return tribeMapper.deleteTribeById(id);
    }
}
